package createoffer.logic;

import java.util.ArrayList;

import testrunner.core.TestRunner;

import createoffer.data.AllFieldsTests;
import createoffer.data.OneFieldTest;
import createoffer.ui.TesterDecision;

public class CreateOfferTests {
	
	public void run(ArrayList<String> codeInjection, int codeInjectionSize) {
		String testerDecision = getTestDecisiosFromUser();
		switch(testerDecision){
		case "all":
			AllFieldsTests allFieldsTests = new AllFieldsTests();
			allFieldsTests.runTests(codeInjection, codeInjectionSize);
			break;
		case "one":
			OneFieldTest oneFieldTests = new OneFieldTest();
			oneFieldTests.runTests(codeInjection, codeInjectionSize);
			break;
		default:
			TestRunner testRunner = new TestRunner();
			try {
				testRunner.run();
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
	}

	private String getTestDecisiosFromUser() {
		TesterDecision testsDecision = new TesterDecision();
		String decision = testsDecision.getTesterDecision();
		return decision;
	}
	
	
	

}
